Optimal. Leaf size=55 \[ \frac {c x}{2}+\frac {d x^2}{4}+\frac {d \cos ^2(a+b x)}{4 b^2}+\frac {(c+d x) \cos (a+b x) \sin (a+b x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {3391}
\begin {gather*} \frac {d \cos ^2(a+b x)}{4 b^2}+\frac {(c+d x) \sin (a+b x) \cos (a+b x)}{2 b}+\frac {c x}{2}+\frac {d x^2}{4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3391
Rubi steps
\begin {align*} \int (c+d x) \cos ^2(a+b x) \, dx &=\frac {d \cos ^2(a+b x)}{4 b^2}+\frac {(c+d x) \cos (a+b x) \sin (a+b x)}{2 b}+\frac {1}{2} \int (c+d x) \, dx\\ &=\frac {c x}{2}+\frac {d x^2}{4}+\frac {d \cos ^2(a+b x)}{4 b^2}+\frac {(c+d x) \cos (a+b x) \sin (a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 50, normalized size = 0.91 \begin {gather*} \frac {d \cos (2 (a+b x))+2 b (2 a c+b x (2 c+d x)+(c+d x) \sin (2 (a+b x)))}{8 b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(111\) vs.
\(2(47)=94\).
time = 0.06, size = 112, normalized size = 2.04
method | result | size |
risch | \(\frac {d \,x^{2}}{4}+\frac {c x}{2}+\frac {d \cos \left (2 b x +2 a \right )}{8 b^{2}}+\frac {\left (d x +c \right ) \sin \left (2 b x +2 a \right )}{4 b}\) | \(46\) |
derivativedivides | \(\frac {-\frac {d a \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )}{b}+c \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )+\frac {d \left (\left (b x +a \right ) \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )-\frac {\left (b x +a \right )^{2}}{4}-\frac {\left (\sin ^{2}\left (b x +a \right )\right )}{4}\right )}{b}}{b}\) | \(112\) |
default | \(\frac {-\frac {d a \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )}{b}+c \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )+\frac {d \left (\left (b x +a \right ) \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )-\frac {\left (b x +a \right )^{2}}{4}-\frac {\left (\sin ^{2}\left (b x +a \right )\right )}{4}\right )}{b}}{b}\) | \(112\) |
norman | \(\frac {\frac {c \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b}+c x \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )-\frac {d \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b^{2}}+\frac {d x \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b}+\frac {c x}{2}+\frac {d \,x^{2}}{4}-\frac {c \left (\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {c x \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{2}+\frac {d \,x^{2} \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{2}+\frac {d \,x^{2} \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{4}-\frac {d x \left (\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}}{\left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )^{2}}\) | \(172\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 90, normalized size = 1.64 \begin {gather*} \frac {2 \, {\left (2 \, b x + 2 \, a + \sin \left (2 \, b x + 2 \, a\right )\right )} c - \frac {2 \, {\left (2 \, b x + 2 \, a + \sin \left (2 \, b x + 2 \, a\right )\right )} a d}{b} + \frac {{\left (2 \, {\left (b x + a\right )}^{2} + 2 \, {\left (b x + a\right )} \sin \left (2 \, b x + 2 \, a\right ) + \cos \left (2 \, b x + 2 \, a\right )\right )} d}{b}}{8 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 53, normalized size = 0.96 \begin {gather*} \frac {b^{2} d x^{2} + 2 \, b^{2} c x + d \cos \left (b x + a\right )^{2} + 2 \, {\left (b d x + b c\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right )}{4 \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 126 vs.
\(2 (49) = 98\).
time = 0.12, size = 126, normalized size = 2.29 \begin {gather*} \begin {cases} \frac {c x \sin ^{2}{\left (a + b x \right )}}{2} + \frac {c x \cos ^{2}{\left (a + b x \right )}}{2} + \frac {d x^{2} \sin ^{2}{\left (a + b x \right )}}{4} + \frac {d x^{2} \cos ^{2}{\left (a + b x \right )}}{4} + \frac {c \sin {\left (a + b x \right )} \cos {\left (a + b x \right )}}{2 b} + \frac {d x \sin {\left (a + b x \right )} \cos {\left (a + b x \right )}}{2 b} - \frac {d \sin ^{2}{\left (a + b x \right )}}{4 b^{2}} & \text {for}\: b \neq 0 \\\left (c x + \frac {d x^{2}}{2}\right ) \cos ^{2}{\left (a \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.55, size = 48, normalized size = 0.87 \begin {gather*} \frac {1}{4} \, d x^{2} + \frac {1}{2} \, c x + \frac {d \cos \left (2 \, b x + 2 \, a\right )}{8 \, b^{2}} + \frac {{\left (b d x + b c\right )} \sin \left (2 \, b x + 2 \, a\right )}{4 \, b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.10, size = 57, normalized size = 1.04 \begin {gather*} \frac {c\,x}{2}+\frac {d\,x^2}{4}+\frac {d\,\cos \left (2\,a+2\,b\,x\right )}{8\,b^2}+\frac {c\,\sin \left (2\,a+2\,b\,x\right )}{4\,b}+\frac {d\,x\,\sin \left (2\,a+2\,b\,x\right )}{4\,b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________